<table class="topics list">
  <tr>
    <th>Topic</th>
    <th>Posted In</th>
    <th>Replies</th>
    <th>Views</th>
    <th>Last Post</th>
  </tr>
<% for topic in @topics %>
  <tr class="topic">
    <td>
      <% if topic.locked? %>
        <span class="locked">Locked</span>
      <% end %>
      <% if topic.sticky? %>
        <span class="sticky">Sticky</span>
      <% end %>
      <%= link_to h(topic.name), topic_path(topic), :class => 'name' %>
      <span class="pagination"><%= topic_pages(topic) %></span>
      <span class="actions">
        <%= link_to 'edit', edit_topic_path(topic) if current_user.can_update_topic? topic %>
        <% if current_user.can_destroy_topic? topic %>
          | <%= link_to 'destroy', topic_path(topic), :confirm => 'Are you sure?', :method => 'delete' %>
        <% end %>
      </span>
    </td>
    <td class="forum"><%= link_to h(topic.forum.name), forum_path(topic.forum) %></td>
    <td class="reply_count"><%= topic.posts.count - 1 %></td>
    <td class="view_count"><%= topic.view_count %></td>
    <td class="last_post">
      <%= link_to_post(topic.last_post) %>
      by <%= link_to_user(topic.last_post.user) %>
    </td>
  </tr>
<% end %>
</table>
